﻿/*
SINACOR - BMF&Bovespa
Arquivo: FiltroAgenteValido.cs
Criado em: 31-mai-2010 09:44:16
Arquiteto Responsável: p-wgeneroso
*/
using System;
using System.Collections.Generic;
using System.Text;
using Sinacor.Infra.Common.Validation;
using Sinacor.Infra.Common.Exceptions;
using Sinacor.Infra.Service.ExceptionHandling;
using Sinacor.Infra.Service.Validation;
using Sinacor.Infra.Service.Validation.BusinessRules;

namespace Sinacor.Servico.Bovespa.Movimento.BusinessLogic.BusinessRuleValidation 
{
	public class FiltroAgenteValido : BaseBusinessRuleValidation<BusinessEntity.Parameter.FiltroAgente>, IBusinessRuleValidation 
	{
        #region Construtores

        /// <summary>
        /// Construtor Padrão
        /// </summary>
        public FiltroAgenteValido()
        {
        }

        #endregion

		#region Métodos

		public List<ValidationError> GetErrors()
		{
            return base.ErrorsList;
		}

		public void Validate()
		{
            SinacorValidation validation = null;

            try
            {
                validation = new SinacorValidation();
                validation.Validate<BusinessEntity.Parameter.FiltroAgente>(base.EntityToValidate);
            }
            catch (ValidationException ex)
            {
                base.AddValidationError(ex.ValidationErrors);
            }
		}

		#endregion
	}
}